package com.zhy.http.library.callback;

import okhttp3.Call;
import okhttp3.Response;

import java.io.InputStream;

public abstract class InputStreamCallback extends Callback<InputStream> {
    @Override
    public InputStream parseNetworkResponse(Response response, int id) throws Exception {
        if (response.body() != null) {
            return response.body().byteStream();
        } else {
            return null;
        }
    }
}
